<?php declare(strict_types=1);

namespace App\Enums;

use BenSampo\Enum\Enum;
use BenSampo\Enum\Exceptions\InvalidEnumMemberException;

/**
 * @method static static OptionOne()
 * @method static static OptionTwo()
 * @method static static OptionThree()
 */
final class OrderPay extends Enum
{
    //支付状态:0=未支付,1=已支付,2=过期
    const WAIT = 0;
    const PAID = 1;
    const EXPIRED = 2;


    /**
     * @param mixed $value
     * @return string
     * @throws InvalidEnumMemberException
     */
    public static function getDescription(mixed $value): string
    {
        return match ($value) {
            self::WAIT => '未支付',
            self::PAID => '已支付',
            self::EXPIRED => '过期',
            default => self::getKey($value),
        };
    }
}
